/*
 * Amkai Enterprise Solution (AES.) 
 * Copyright 2004 by Amkai(TM), Inc.
 * www.amkai.com
 * 
 * Project: webservice
 * Package: com.amkai.aes.webservice.binary.objecthandler
 * File: PassportListHandler.java
 * Created: Nov 26, 2005 2:20:40 PM
 * Author: johnny 
 * 
 */
package com.amkai.aes.webservice.binary.objecthandler;

import java.io.Serializable;
import java.util.List;

import com.amkai.aes.aescommon.service.binary.job.PassportListJob;
import com.amkai.aes.aescommon.service.result.PassportListResult;
import com.amkai.aes.generatedbeans.passport.Passport;
import com.amkai.aes.server.hibernate.managment.PassportManager;
import com.amkai.aes.webservice.binary.JobObjectHandler;

public class PassportListHandler implements JobObjectHandler<PassportListJob, Serializable, PassportListResult> {

	public PassportListResult process(PassportListJob job, Serializable object) throws Exception {
		PassportManager pm;
		try {
			pm = new PassportManager();
			PassportListResult result = new PassportListResult();
			List<Passport> list = pm.getPassports(-1);
			result.setPassports(list);
			return result;
		} catch (Throwable t) {
			t.printStackTrace();
			throw new Exception(t);
		}
	}

}
